# coding: utf-8
import os

from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
# Uncomment the next two lines to enable the admin:
from recette.views import index, fiche

admin.autodiscover()

urlpatterns = patterns('',
    # Example:

    url(r'^admin/(.*)',         admin.site.root),
    url(r'^$', index, name="index"),
    url(r'^(?P<recette_id>\d+)$', fiche, name="fiche"),
    
    
    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
)

from django.contrib import databrowse
urlpatterns += patterns('django.views.static',
    (r'^media/(?P<path>.*)$',
        'serve',
        dict(
            document_root = os.path.join(settings.PROJECT_PATH, 'media'),
            show_indexes = False
        )
    ),
    (r'^databrowse/(.*)', databrowse.site.root),
)
